const express = require('express');
var customerController = require('../controller/customer.controller');

module.exports = (app)=>{
    var router = express.Router();

    router.route('/')
        .post(customerController.addCustomer);

    router.route('/')
        .put(customerController.updateCustomer);

    router.route('/findByCustomerName/:cName')
        .get(customerController.findByCustomerName);

    router.route('/findByCustomerNameAndPwd/:cName/:cpwd')
        .get(customerController.findByCustomerNameAndPwd);

    router.route('/addAddress')
        .put(customerController.addAddress);

    router.route('/findAddressList/:customerId')
        .get(customerController.findAddressList);


    router.route('/:customerId/deleteAddress/:addressId')
        .delete(customerController.deleteAddress);

    router.route('/isLogin')
        .get(customerController.isLogin);

    router.route('/logout')
        .delete(customerController.Logout);


    app.use('/customers',router);

    return router;
}